home *** CD-ROM | disk | FTP | other *** search
/ Collection of Internet / Collection of Internet.iso / msdos / lynx / source / doslynx / inc / textattr.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-10-25  |  2.1 KB  |  77 lines

  1. #ifndef __TEXTATTRIBUTE_H
  2. //    Avoid include redundancy
  3. #define __TEXTATTRIBUTE_H
  4.  
  5. //    Copyright (c) 1994, University of Kansas, All Rights Reserved
  6. //
  7. //    Include File:    textattr.h
  8. //    Purpose:    Class implementation of a WWW style of attributes
  9. //            possible on a stream of data.
  10. //    Remarks/Portability/Dependencies/Restrictions:
  11. //        Revised the paragraph to hold an index variable if included
  12. //        in a list to help with a problem when used in a TNSCollection.
  13. //        For some reason, it is a fatal error in doslynx.
  14. //    Revision History:
  15. //        02-01-94    created
  16.  
  17. //    Constant defines
  18.  
  19. //    Required includes
  20. extern "C"    {
  21. #include"htanchor.h"
  22. };
  23.  
  24. //    Class declarations
  25. class TextAttribute    {
  26. public:
  27.     //    The different type of attributes possible.
  28.     enum AttributeType    {
  29.         anchor        =    0x1,
  30.     };
  31.  
  32.     //    A pointer to the attribute structure or other useful
  33.     //    information for a text attribute.
  34.     union    {
  35.         const HTChildAnchor *HTCAp_anchor;
  36.     };
  37.  
  38.     //    Constructors.
  39.     //    for child anchor.
  40.     TextAttribute(const HTChildAnchor *HTCAp, const signed long int
  41.         sli_Offset = 0L, const signed long int sli_OffsetPlusExtent
  42.         = 0L);
  43.  
  44.     //    Destructor.
  45.     ~TextAttribute();
  46.  
  47.     //    Set the offset.
  48.     void Begin(const signed long int sli_Offset);
  49.     //    End the offset.
  50.     void End(const signed long int sli_OffsetPlusExtent);
  51.     //    Return the beginning offset.
  52.     signed long int getBegin() const;
  53.     //    Return the ending offset.
  54.     signed long int getEnd() const;
  55.     //    Return the type of attribute
  56.     AttributeType getType() const;
  57.     //    Return the extent of an attribute
  58.     signed long int getExtent() const;
  59.     //    Return whether or not a stream offset is in the range of
  60.     //    an attribute.
  61.     unsigned char inRange(const signed long int sli_Offset)
  62.         const;
  63. private:
  64.     //    The specific type of attribute that this is.
  65.     AttributeType AT_StreamType;
  66.     //    The offset of where the attribute begins in a stream.
  67.     signed long int sli_StreamOffset;
  68.     //    The offset of where the attribute once ends.
  69.     signed long int sli_StreamExtent;
  70. };
  71.  
  72. //    Global variable declarations
  73.  
  74. //    Macros
  75.  
  76. #endif // __TEXTATTRIBUTE_H
  77.